fix downstream lazy entry classification - #266
Conversation
🦋 Changeset detectedLatest commit: 8095fc7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
Downstream plugins inspecting the client bundle in generateBundle (and Vite's manifest plugin serializing it) saw lazy facade chunks marked isEntry, mistaking them for application entries. Apply the existing reclassification to the Rollup bundle itself, ahead of the client asset map build. Ports the fix from #266. Co-authored-by: Brenley Dueck <brenleydueck@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thanks @brenelz — this was a real gap and your diagnosis was right on. Landed in 36428cb with you as co-author, so the credit is preserved in the history and the changelog. Closing this one out — thanks again for the contribution! |
Summary
Reclassify emitted
lazy()facade chunks in the raw Rollup output bundle so downstream plugins do not mistake them for application entry points.Problem
SSR-mode client builds emit dynamically imported project modules as explicit facade chunks. This ensures each lazy module receives a stable manifest entry, but Rollup can mark those emitted chunks as
isEntry: trueeven though they are dynamically imported by another chunk.vite-plugin-solidalready corrects this classification when loading the serialized Vite manifest. However, plugins that inspect the raw output bundle duringgenerateBundlerun before that correction and can observe multiple apparent application entries.For example, TanStack Start's client manifest plugin failed on Linux with:
The
indexchunk is the actual client entry, while therouteschunk is an emitted lazy facade.Fix
Run the existing
normalizeEmittedLazyEntrieshelper fromgenerateBundleas well as when loading the serialized manifest.This changes chunks that are both:
from
isEntrytoisDynamicEntrybefore downstream output hooks inspect the bundle. The real client entry remains unchanged.Verification
pnpm build